<script type="text/javascript">
function chg(id){
 var str= "a"+id
 var oa = document.getElementById(id);
 var ob = document.getElementById(str);
 if(oa){
  if(oa.style.display == "block"){
   oa.style.display = "none";
   ob.innerHTML = "<em style='padding-right:5px;'>+<\/em>";
  }else{
   oa.style.display = "block";
   ob.innerHTML = "<em style='padding-right:10px'>-<\/em>";
  }
 }
 return false;
}
</script>
<div id="Category" class="blank clearfix">
  <span class="TL"></span>
	<span class="TR"></span> 
	<span class="BL"></span> 
	<span class="BR"></span> 
	<div class="Tit"></div>
 <ul>
<?php $_from = $this->_var['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'cat');$this->_foreach['parent-cat'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['parent-cat']['total'] > 0):
    foreach ($_from AS $this->_var['cat']):
        $this->_foreach['parent-cat']['iteration']++;
?>
 <li>
 <div class="clearfix">
  <span id="acat<?php echo $this->_foreach['parent-cat']['iteration']; ?>" onclick="return chg('cat<?php echo $this->_foreach['parent-cat']['iteration']; ?>');" style="cursor:pointer; float:right;">
	  <em>
	    <?php if ($this->_var['cat']['cat_id']): ?>
			+
			<?php else: ?>
			-
			<?php endif; ?>   
	</em>
	</span>	
	<a href="<?php echo $this->_var['cat']['url']; ?>" style="float:left;"><?php echo htmlspecialchars($this->_var['cat']['name']); ?></a></div>
  <?php if ($this->_var['cat']['cat_id']): ?>
   <div class="child_cat" id="cat<?php echo $this->_foreach['parent-cat']['iteration']; ?>" style="display:none;">
    <ul>
   <?php $_from = $this->_var['cat']['cat_id']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'child');if (count($_from)):
    foreach ($_from AS $this->_var['child']):
?> 
    <li>
    <a href="<?php echo $this->_var['child']['url']; ?>"><?php echo htmlspecialchars($this->_var['child']['name']); ?></a>
    </li>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
 </div>
  <?php endif; ?>
 </li>
 <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
	</ul>	
</div>
